<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客编辑页面</title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/blog_edit.css">
    <link rel="stylesheet" href="editor.md/css/editormd.min.css">
    <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="editor.md/lib/marked.min.js"></script>
    <script src="editor.md/lib/prettify.min.js"></script>
    <script src="editor.md/editormd.js"></script>
</head>
<body>
<div class="nav">
    <img src="image/123.jpg" alt="" width="40px">
    <span class="title">我的博客系统</span>
    <span class="spacer"></span>
    <a href="blog_list.html">主页</a>
    <a href="#">写博客</a>
    <a href="login/logout">注销</a>
</div>
<div class="edit-container">
    <!-- 标题编辑区域 -->
    <form action="blog/addblog" method="post" style="height: 100%;">
        <div class="title">
            <input type="text" id="text" placeholder="请输入标题" name="title">
            <input type="submit" id="submit" value="发布文章" onclick="myJump()">
            <!-- <button id="submit">发布文章</button> -->
        </div>
        <!-- 内容编辑区域 -->
        <div id="editor">
            <textarea name="content" style="display:none;"></textarea>
        </div>
    </form>
</div>
<script>
    var editor = editormd("editor",{
        width:"100%",
        height:"calc(100% - 50px)",
        markdown:"# 在这里写下一篇博客",
        path:"editor.md/lib/",
        saveHTMLToTextarea: true
    });

    function myJump() {
        $.ajax({
           success: function () {
               alert("发布成功");
               location.assign("blog_list.html");
           }
        });
    }
</script>

</body>
</html>